<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="./css/jquery.mobile-1.4.5.min.css">
    <script type="text/javascript" src="./js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="./js/jquery.mobile-1.4.5.min.js"></script>
    <style type="text/css">

    </style>
    <script type="text/javascript">
        $(document).ready(function(){
        <c:forEach var="banner" items="${banners}" varStatus="i">
            $("#banner${i.index}").click(function(){
                location.href = "${banner.bannerUrl}"
            });
         </c:forEach>

        });
    </script>
</head>
<body>

<div data-role="page">
    <div data-role="content">

        <c:forEach var="banner" items="${banners}" varStatus="i">
            <div>
                <c:choose>
                    <c:when test="${fn:startsWith(banner.bannerIcon,'http')}">
                    <img id="banner${i.index}" style="width:100%;" src="${banner.bannerIcon}" alt="${banner.bannerName}">
                </c:when>
                <c:otherwise>
                    <img id="banner${i.index}" style="width:100%;" src="http://pic.handpay.cn/hpay/micro${banner.bannerIcon}" alt="${banner.bannerName}">
                </c:otherwise>
                </c:choose>
            </div>
        </c:forEach>
    </div>
</div>

</body>
</html>
